package ducpham.rogueconsole.mark2;

import java.awt.Image;
import java.util.HashMap;

public abstract class ASpriteCanvas implements ISpriteCanvas {

	private HashMap<String, Image> canvas = new HashMap<String, Image>();

	public ASpriteCanvas() {
		clearCanvas();
	}

	@Override
	public Image getSprite(String desc) {
		return canvas.get(desc);
	}

	@Override
	public void clearCanvas() {
		canvas = new HashMap<String, Image>();
	}

	@Override
	public Image addSprite(String desc, Image sprite) {
		return canvas.put(desc, sprite);
	}

}
